public class HomeworkNameValidator {

    public static void main(String[] args) {

        System.out.println(isValidHomeworkName("3_21.rar"));
        System.out.println(isValidHomeworkName("xiaowu.zipa")); 
        System.out.println(isValidHomeworkName("张洋.rar")); 
        System.out.println(isValidHomeworkName("张洋.zip")); 
        System.out.println(isValidHomeworkName("zhangyang.rar"));
        System.out.println(isValidHomeworkName("zhangyang.java"));
    }

    public static boolean isValidHomeworkName(String name) {
 if (!(name.endsWith(".zip") || name.endsWith(".rar"))) {
            return false;
        }

        if (!name.matches(".*[\\u4e00-\\u9fa5]+.*")) {
            return false;
        }

        String[] parts = name.split("[._]");
        if (parts.length > 0 && parts[0].matches("[\\u4e00-\\u9fa5]+")) {
            return true;
        } else {
            return false;
        }
    }
}
